<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
					<div id="bodyContent">
						<h1>Flujos de Preimplementaci&oacute;n de Eventos</h1>
						<div class='errors'><html:errors/>${UserLogin.messageError}</div><br/>
                                                <span class="contentBtn">
                                                    <a href="${URLBase}Cotizaciones.do">
                                                        Cotizaciones
                                                    </a>&nbsp;&nbsp;
                                                    <a href="${URLBase}PreimplementacionEventoAlta.do">
                                                        <img src="${URLBase}images/btnAdd.gif" />
                                                    </a>
                                                </span>
						<br/>
<c:set value="${fn:length(Preimplementations)}" var="PreimplementationsLength" />
<c:choose>
<c:when test="${PreimplementationsLength eq 0}">
						<center>No existen registros</center>
</c:when>
<c:otherwise>
						<html:form action="/PreimplementacionEventoCancelarFlujo" method="post" styleId="Forma">
						<html:hidden property="cveFlujo" styleId="cveFlujo"/>
						<table class="tabDatos">
							<thead>
								<tr>
									<th>Flujo</th>
									<th>Assets</th>
									<th>Estado</th>
									<th>Cancelar</th>
<%-- 
									<th></th>
 --%>
								</tr>
							</thead>
<c:forEach items="${Preimplementations}" var="pre" varStatus="preStatus">
							<tr onmouseover="this.style.background='lightgray';" onmouseout="this.style.background='white';">
								<td onclick="javascript: document.getElementById( 'Forma' ).action = '${URLBase}PreimplementacionEventoVerDetalleFlujo.do';document.getElementById( 'cveFlujo' ).value=${pre.cvePreimplementacion };document.getElementById( 'Forma' ).submit();" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${pre.tblFlujo.nombre}</td>
								<td onclick="javascript: document.getElementById( 'Forma' ).action = '${URLBase}PreimplementacionEventoVerDetalleFlujo.do';document.getElementById( 'cveFlujo' ).value=${pre.cvePreimplementacion };document.getElementById( 'Forma' ).submit();" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">
<c:forEach items="${pre.tblAssets}" var="asset" varStatus="status">									${asset.nombre }<br/></c:forEach>
								</td>
								<td onclick="javascript: document.getElementById( 'Forma' ).action = '${URLBase}PreimplementacionEventoVerDetalleFlujo.do';document.getElementById( 'cveFlujo' ).value=${pre.cvePreimplementacion };document.getElementById( 'Forma' ).submit();" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';"><c:choose><c:when test="${pre.bandera eq 1}">Iniciado</c:when><c:when test="${pre.bandera eq 2}">Finalizado Correctamente</c:when><c:when test="${pre.bandera eq 3}">Detenido por CM</c:when><c:otherwise>Desconocido</c:otherwise></c:choose></td>
								<td>
<c:choose>
<c:when test="${pre.bandera eq 1}">
									<html:image src="images/btnCancelar.gif" onclick="if( confirm( 'Seguro que quieres detener el flujo?' ) ){ document.getElementById( 'cveFlujo' ).value = ${pre.cvePreimplementacion }; return true ;} else{ return false ;}" />
</c:when>
<c:when test="${pre.bandera eq 2}">
									Finalizado
</c:when>
<c:when test="${pre.bandera eq 3}">
									Cancelado
</c:when>
<c:otherwise>
									----
</c:otherwise>
</c:choose>
								</td>
<%-- 
								<td>
									
								</td>
 --%>
							</tr>
</c:forEach>
						</table>
						</html:form>
</c:otherwise>
</c:choose>
					</div>
					<div id="footContent"></div>
